home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 August: Technology Seed / August 1998 ADC Seed CD.toast / Mac OS 8.5b2 / allegro-b2-pseudo-SDK / CIncludes / Appearance.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-07-17  |  65.0 KB  |  1,573 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Appearance.h
  3.  
  4.      Contains:    Appearance Manager Interfaces.
  5.  
  6.      Version:    Technology:    Allegro
  7.                  Release:    Allego Seed, Use with 3.1 Universal Interfaces
  8.  
  9.      Copyright:    © 1994-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __APPEARANCE__
  19. #define __APPEARANCE__
  20.  
  21. #ifndef __MACTYPES__
  22. #include <MacTypes.h>
  23. #endif
  24. #ifndef __QUICKDRAW__
  25. #include <Quickdraw.h>
  26. #endif
  27. #ifndef __TEXTEDIT__
  28. #include <TextEdit.h>
  29. #endif
  30. #ifndef __QDOFFSCREEN__
  31. #include <QDOffscreen.h>
  32. #endif
  33. #ifndef __MACWINDOWS__
  34. #include <MacWindows.h>
  35. #endif
  36. #ifndef __CONTROLS__
  37. #include <Controls.h>
  38. #endif
  39.  
  40. /*——————————————————————————————————————————————————————————————————————————————————*/
  41. /* Appearance Manager constants, etc.                                                */
  42. /*——————————————————————————————————————————————————————————————————————————————————*/
  43.  
  44.  
  45. #if PRAGMA_ONCE
  46. #pragma once
  47. #endif
  48.  
  49. #ifdef __cplusplus
  50. extern "C" {
  51. #endif
  52.  
  53. #if PRAGMA_IMPORT
  54. #pragma import on
  55. #endif
  56.  
  57. #if PRAGMA_STRUCT_ALIGN
  58.     #pragma options align=mac68k
  59. #elif PRAGMA_STRUCT_PACKPUSH
  60.     #pragma pack(push, 2)
  61. #elif PRAGMA_STRUCT_PACK
  62.     #pragma pack(2)
  63. #endif
  64.  
  65.  
  66. enum {
  67.                                                                 /* Appearance Trap Number */
  68.     _AppearanceDispatch            = 0xAA74
  69. };
  70.  
  71. /* Gestalt selector and values for the Appearance Manager */
  72.  
  73. enum {
  74.     gestaltAppearanceAttr        = FOUR_CHAR_CODE('appr'),
  75.     gestaltAppearanceExists        = 0,
  76.     gestaltAppearanceCompatMode    = 1
  77. };
  78.  
  79. /* Gestalt selector for determining Appearance Manager version      */
  80. /* If this selector does not exist, but gestaltAppearanceAttr     */
  81. /* does, it indicates that the 1.0 version is installed. This     */
  82. /* gestalt returns a BCD number representing the version of the     */
  83. /* Appearance Manager that is currently running, e.g. 0x0101 for */
  84. /* version 1.0.1.                                                 */
  85.  
  86. enum {
  87.     gestaltAppearanceVersion    = FOUR_CHAR_CODE('apvr')
  88. };
  89.  
  90. /* Appearance Manager Apple Events (1.1 and later)                 */
  91.  
  92. enum {
  93.     kAppearanceEventClass        = FOUR_CHAR_CODE('appr'),        /* Event Class */
  94.     kAEAppearanceChanged        = FOUR_CHAR_CODE('thme'),        /* Appearance changed (e.g. platinum to hi-tech) */
  95.     kAESystemFontChanged        = FOUR_CHAR_CODE('sysf'),        /* system font changed */
  96.     kAESmallSystemFontChanged    = FOUR_CHAR_CODE('ssfn'),        /* small system font changed */
  97.     kAEViewsFontChanged            = FOUR_CHAR_CODE('vfnt')        /* views font changed */
  98. };
  99.  
  100. /*——————————————————————————————————————————————————————————————————————————————————*/
  101. /* Appearance Manager file types                                                    */
  102. /*——————————————————————————————————————————————————————————————————————————————————*/
  103.  
  104. enum {
  105.     kThemeDataFileType            = FOUR_CHAR_CODE('thme'),        /* file type for theme files */
  106.     kThemePlatinumFileType        = FOUR_CHAR_CODE('pltn'),        /* file type for platinum appearance */
  107.     kThemeCustomThemesFileType    = FOUR_CHAR_CODE('scen'),        /* file type for user themes */
  108.     kThemeSoundTrackFileType    = FOUR_CHAR_CODE('tsnd')
  109. };
  110.  
  111. /* Appearance Manager Error Codes */
  112.  
  113. enum {
  114.     themeInvalidBrushErr        = -30560,                        /* pattern index invalid */
  115.     themeProcessRegisteredErr    = -30561,
  116.     themeProcessNotRegisteredErr = -30562,
  117.     themeBadTextColorErr        = -30563,
  118.     themeHasNoAccentsErr        = -30564,
  119.     themeBadCursorIndexErr        = -30565,
  120.     themeScriptFontNotFoundErr    = -30566,                        /* theme font requested for uninstalled script system */
  121.     themeMonitorDepthNotSupportedErr = -30567                    /* theme not supported at monitor depth */
  122. };
  123.  
  124.  
  125. enum {
  126.     kThemeBrushDialogBackgroundActive = 1,                        /* Dialogs */
  127.     kThemeBrushDialogBackgroundInactive = 2,                    /* Dialogs */
  128.     kThemeBrushAlertBackgroundActive = 3,
  129.     kThemeBrushAlertBackgroundInactive = 4,
  130.     kThemeBrushModelessDialogBackgroundActive = 5,
  131.     kThemeBrushModelessDialogBackgroundInactive = 6,
  132.     kThemeBrushUtilityWindowBackgroundActive = 7,                /* Miscellaneous */
  133.     kThemeBrushUtilityWindowBackgroundInactive = 8,                /* Miscellaneous */
  134.     kThemeBrushListViewSortColumnBackground = 9,                /* Finder */
  135.     kThemeBrushListViewBackground = 10,
  136.     kThemeBrushIconLabelBackground = 11,
  137.     kThemeBrushListViewSeparator = 12,
  138.     kThemeBrushChasingArrows    = 13,
  139.     kThemeBrushDragHilite        = 14,
  140.     kThemeBrushDocumentWindowBackground = 15,
  141.     kThemeBrushFinderWindowBackground = 16
  142. };
  143.  
  144. /* Brushes available in Appearance 1.1 or later */
  145.  
  146. enum {
  147.     kThemeBrushScrollBarDelimiterActive = 17,
  148.     kThemeBrushScrollBarDelimiterInactive = 18,
  149.     kThemeBrushFocusHighlight    = 19,
  150.     kThemeBrushPopupArrowActive    = 20,
  151.     kThemeBrushPopupArrowPressed = 21,
  152.     kThemeBrushPopupArrowInactive = 22,
  153.     kThemeBrushAppleGuideCoachmark = 23,
  154.     kThemeBrushIconLabelBackgroundSelected = 24,
  155.     kThemeBrushStaticAreaFill    = 25,
  156.     kThemeBrushActiveAreaFill    = 26,
  157.     kThemeBrushButtonFrameActive = 27,
  158.     kThemeBrushButtonFrameInactive = 28,
  159.     kThemeBrushButtonFaceActive    = 29,
  160.     kThemeBrushButtonFaceInactive = 30,
  161.     kThemeBrushButtonFacePressed = 31,
  162.     kThemeBrushButtonActiveDarkShadow = 32,
  163.     kThemeBrushButtonActiveDarkHighlight = 33,
  164.     kThemeBrushButtonActiveLightShadow = 34,
  165.     kThemeBrushButtonActiveLightHighlight = 35,
  166.     kThemeBrushButtonInactiveDarkShadow = 36,
  167.     kThemeBrushButtonInactiveDarkHighlight = 37,
  168.     kThemeBrushButtonInactiveLightShadow = 38,
  169.     kThemeBrushButtonInactiveLightHighlight = 39,
  170.     kThemeBrushButtonPressedDarkShadow = 40,
  171.     kThemeBrushButtonPressedDarkHighlight = 41,
  172.     kThemeBrushButtonPressedLightShadow = 42,
  173.     kThemeBrushButtonPressedLightHighlight = 43,
  174.     kThemeBrushBevelActiveLight    = 44,
  175.     kThemeBrushBevelActiveDark    = 45,
  176.     kThemeBrushBevelInactiveLight = 46,
  177.     kThemeBrushBevelInactiveDark = 47
  178. };
  179.  
  180. /* These values are meta-brushes, specific colors that do not         */
  181. /* change from theme to theme. You can use them instead of using    */
  182. /* direct RGB values.                                                 */
  183.  
  184. enum {
  185.     kThemeBrushBlack            = -1,
  186.     kThemeBrushWhite            = -2
  187. };
  188.  
  189. typedef SInt16                             ThemeBrush;
  190.  
  191. enum {
  192.     kThemeTextColorDialogActive    = 1,
  193.     kThemeTextColorDialogInactive = 2,
  194.     kThemeTextColorAlertActive    = 3,
  195.     kThemeTextColorAlertInactive = 4,
  196.     kThemeTextColorModelessDialogActive = 5,
  197.     kThemeTextColorModelessDialogInactive = 6,
  198.     kThemeTextColorWindowHeaderActive = 7,
  199.     kThemeTextColorWindowHeaderInactive = 8,
  200.     kThemeTextColorPlacardActive = 9,
  201.     kThemeTextColorPlacardInactive = 10,
  202.     kThemeTextColorPlacardPressed = 11,
  203.     kThemeTextColorPushButtonActive = 12,
  204.     kThemeTextColorPushButtonInactive = 13,
  205.     kThemeTextColorPushButtonPressed = 14,
  206.     kThemeTextColorBevelButtonActive = 15,
  207.     kThemeTextColorBevelButtonInactive = 16,
  208.     kThemeTextColorBevelButtonPressed = 17,
  209.     kThemeTextColorPopupButtonActive = 18,
  210.     kThemeTextColorPopupButtonInactive = 19,
  211.     kThemeTextColorPopupButtonPressed = 20,
  212.     kThemeTextColorIconLabel    = 21,
  213.     kThemeTextColorListView        = 22
  214. };
  215.  
  216. /* Text Colors available in Appearance 1.0.1 or later */
  217.  
  218. enum {
  219.     kThemeTextColorDocumentWindowTitleActive = 23,
  220.     kThemeTextColorDocumentWindowTitleInactive = 24,
  221.     kThemeTextColorMovableModalWindowTitleActive = 25,
  222.     kThemeTextColorMovableModalWindowTitleInactive = 26,
  223.     kThemeTextColorUtilityWindowTitleActive = 27,
  224.     kThemeTextColorUtilityWindowTitleInactive = 28,
  225.     kThemeTextColorPopupWindowTitleActive = 29,
  226.     kThemeTextColorPopupWindowTitleInactive = 30,
  227.     kThemeTextColorRootMenuActive = 31,
  228.     kThemeTextColorRootMenuSelected = 32,
  229.     kThemeTextColorRootMenuDisabled = 33,
  230.     kThemeTextColorMenuItemActive = 34,
  231.     kThemeTextColorMenuItemSelected = 35,
  232.     kThemeTextColorMenuItemDisabled = 36,
  233.     kThemeTextColorPopupLabelActive = 37,
  234.     kThemeTextColorPopupLabelInactive = 38
  235. };
  236.  
  237.  
  238. /* Text colors available in Appearance 1.1 or later */
  239.  
  240. enum {
  241.     kThemeTextColorTabFrontActive = 39,
  242.     kThemeTextColorTabNonFrontActive = 40,
  243.     kThemeTextColorTabNonFrontPressed = 41,
  244.     kThemeTextColorTabFrontInactive = 42,
  245.     kThemeTextColorTabNonFrontInactive = 43,
  246.     kThemeTextColorIconLabelSelected = 44
  247. };
  248.  
  249. /* These values are specific colors that do not change from             */
  250. /* theme to theme. You can use them instead of using direct RGB values. */
  251.  
  252. enum {
  253.     kThemeTextColorBlack        = -1,
  254.     kThemeTextColorWhite        = -2
  255. };
  256.  
  257.  
  258. typedef SInt16                             ThemeTextColor;
  259. /* States to draw primitives: disabled, active, and pressed (hilited) */
  260.  
  261. enum {
  262.     kThemeStateInactive            = 0,
  263.     kThemeStateActive            = 1,
  264.     kThemeStatePressed            = 2
  265. };
  266.  
  267. /* obsolete name */
  268.  
  269. enum {
  270.     kThemeStateDisabled            = 0
  271. };
  272.  
  273.  
  274. enum {
  275.     kThemeStatePressedUp        = 2,                            /* draw with up pressed        (increment/decrement buttons) */
  276.     kThemeStatePressedDown        = 3                                /* draw with down pressed    (increment/decrement buttons) */
  277. };
  278.  
  279. typedef UInt32                             ThemeDrawState;
  280. /*——————————————————————————————————————————————————————————————————————————————————*/
  281. /* Theme cursor selectors available in Appearance 1.1 or later                        */
  282. /*——————————————————————————————————————————————————————————————————————————————————*/
  283.  
  284. enum {
  285.     kThemeArrowCursor            = 0,
  286.     kThemeCopyArrowCursor        = 1,
  287.     kThemeAliasArrowCursor        = 2,
  288.     kThemeContextualMenuArrowCursor = 3,
  289.     kThemeIBeamCursor            = 4,
  290.     kThemeCrossCursor            = 5,
  291.     kThemePlusCursor            = 6,
  292.     kThemeWatchCursor            = 7,                            /* Can Animate */
  293.     kThemeClosedHandCursor        = 8,
  294.     kThemeOpenHandCursor        = 9,
  295.     kThemePointingHandCursor    = 10,
  296.     kThemeCountingUpHandCursor    = 11,                            /* Can Animate */
  297.     kThemeCountingDownHandCursor = 12,                            /* Can Animate */
  298.     kThemeCountingUpAndDownHandCursor = 13,                        /* Can Animate */
  299.     kThemeSpinningCursor        = 14,                            /* Can Animate */
  300.     kThemeResizeLeftCursor        = 15,
  301.     kThemeResizeRightCursor        = 16,
  302.     kThemeResizeLeftRightCursor    = 17
  303. };
  304.  
  305. typedef UInt32                             ThemeCursor;
  306. /*——————————————————————————————————————————————————————————————————————————————————*/
  307. /* Theme menu bar drawing states                                                    */
  308. /*——————————————————————————————————————————————————————————————————————————————————*/
  309.  
  310. enum {
  311.     kThemeMenuBarNormal            = 0,
  312.     kThemeMenuBarSelected        = 1
  313. };
  314.  
  315. typedef UInt16                             ThemeMenuBarState;
  316. /* attributes */
  317.  
  318. enum {
  319.     kThemeMenuSquareMenuBar        = (1 << 0)
  320. };
  321.  
  322. /*——————————————————————————————————————————————————————————————————————————————————*/
  323. /* Theme menu drawing states                                                        */
  324. /*——————————————————————————————————————————————————————————————————————————————————*/
  325.  
  326. enum {
  327.     kThemeMenuActive            = 0,
  328.     kThemeMenuSelected            = 1,
  329.     kThemeMenuInactive            = 3
  330. };
  331.  
  332. /* obsolete name */
  333.  
  334. enum {
  335.     kThemeMenuDisabled            = 3
  336. };
  337.  
  338. typedef UInt16                             ThemeMenuState;
  339. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  340. /* MenuType: add kThemeMenuTypeInactive to menu type for DrawThemeMenuBackground if entire     */
  341. /* menu is inactive                                                                            */
  342. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  343.  
  344. enum {
  345.     kThemeMenuTypePullDown        = 0,
  346.     kThemeMenuTypePopUp            = 1,
  347.     kThemeMenuTypeHierarchical    = 2,
  348.     kThemeMenuTypeInactive        = 0x0100
  349. };
  350.  
  351. typedef UInt16                             ThemeMenuType;
  352.  
  353. enum {
  354.     kThemeMenuItemPlain            = 0,
  355.     kThemeMenuItemHierarchical    = 1,                            /* item has hierarchical arrow*/
  356.     kThemeMenuItemScrollUpArrow    = 2,                            /* for scrollable menus, indicates item is scroller*/
  357.     kThemeMenuItemScrollDownArrow = 3,
  358.     kThemeMenuItemAtTop            = 0x0100,                        /* indicates item is being drawn at top of menu*/
  359.     kThemeMenuItemAtBottom        = 0x0200,                        /* indicates item is being drawn at bottom of menu*/
  360.     kThemeMenuItemHasIcon        = 0x8000                        /* add into non-arrow type when icon present.*/
  361. };
  362.  
  363. typedef UInt16                             ThemeMenuItemType;
  364. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  365. /* Theme Backgrounds                                                                        */
  366. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  367.  
  368. enum {
  369.     kThemeBackgroundTabPane        = 1,
  370.     kThemeBackgroundPlacard        = 2,
  371.     kThemeBackgroundWindowHeader = 3,
  372.     kThemeBackgroundListViewWindowHeader = 4
  373. };
  374.  
  375. typedef UInt32                             ThemeBackgroundKind;
  376. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  377. /* Theme Collection tags for Get/SetTheme                                                    */
  378. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  379.  
  380. enum {
  381.     kThemeNameTag                = FOUR_CHAR_CODE('name'),        /* Str255*/
  382.     kThemeThemeFileNameTag        = FOUR_CHAR_CODE('thme'),        /* Str255*/
  383.     kThemeVariantNameTag        = FOUR_CHAR_CODE('varn'),        /* Str255*/
  384.     kThemeSystemFontTag            = FOUR_CHAR_CODE('lgsf'),        /* Str255*/
  385.     kThemeSmallSystemFontTag    = FOUR_CHAR_CODE('smsf'),        /* Str255*/
  386.     kThemeViewsFontTag            = FOUR_CHAR_CODE('vfnt'),        /* Str255*/
  387.     kThemeViewsFontSizeTag        = FOUR_CHAR_CODE('vfsz'),        /* SInt16*/
  388.     kThemeDesktopPatternNameTag    = FOUR_CHAR_CODE('patn'),        /* Str255*/
  389.     kThemeDesktopPatternTag        = FOUR_CHAR_CODE('patt'),        /* <variable-length data> (flattened pattern)*/
  390.     kThemeDesktopPictureNameTag    = FOUR_CHAR_CODE('dpnm'),        /* Str255*/
  391.     kThemeDesktopPictureAliasTag = FOUR_CHAR_CODE('dpal'),        /* <alias handle>*/
  392.     kThemeHighlightColorNameTag    = FOUR_CHAR_CODE('hcnm'),        /* Str255*/
  393.     kThemeHighlightColorTag        = FOUR_CHAR_CODE('hcol'),        /* RGBColor*/
  394.     kThemeExamplePictureIDTag    = FOUR_CHAR_CODE('epic'),        /* SInt16*/
  395.     kThemeSoundsEnabledTag        = FOUR_CHAR_CODE('snds'),        /* Boolean*/
  396.     kThemeSoundTrackNameTag        = FOUR_CHAR_CODE('sndt'),        /* Str255*/
  397.     kThemeSoundMaskTag            = FOUR_CHAR_CODE('smsk'),        /* UInt32*/
  398.     kThemeUserDefinedTag        = FOUR_CHAR_CODE('user'),        /* Boolean (this should _always_ be true if present - used by Control Panel).*/
  399.     kThemeScrollBarArrowStyleTag = FOUR_CHAR_CODE('sbar'),        /* ThemeScrollBarArrowStyle*/
  400.     kThemeScrollBarThumbStyleTag = FOUR_CHAR_CODE('sbth'),        /* ThemeScrollBarThumbStyle*/
  401.     kThemeSmoothFontEnabledTag    = FOUR_CHAR_CODE('smoo'),        /* Boolean*/
  402.     kThemeSmoothFontMinSizeTag    = FOUR_CHAR_CODE('smos'),        /* UInt16 (must be >= 9 and <= 24)*/
  403.     kThemeDblClickCollapseTag    = FOUR_CHAR_CODE('coll')        /* Boolean*/
  404. };
  405.  
  406. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  407. /* Theme Control Settings                                                                    */
  408. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  409.  
  410. enum {
  411.     kThemeCheckBoxClassicX        = 0,                            /* check box with an 'X'*/
  412.     kThemeCheckBoxCheckMark        = 1                                /* check box with a real check mark*/
  413. };
  414.  
  415. typedef UInt16                             ThemeCheckBoxStyle;
  416.  
  417. enum {
  418.     kThemeScrollBarArrowsSingle    = 0,                            /* single arrow on each end*/
  419.     kThemeScrollBarArrowsDouble    = 1,                            /* double arrow on each end*/
  420.     kThemeScrollBarArrowsLowerRight = 2                            /* double arrows only on right or bottom*/
  421. };
  422.  
  423. typedef UInt16                             ThemeScrollBarArrowStyle;
  424.  
  425. enum {
  426.     kThemeScrollBarThumbNormal    = 0,                            /* normal, classic thumb size*/
  427.     kThemeScrollBarThumbProportional = 1                        /* proportional thumbs*/
  428. };
  429.  
  430. typedef UInt16                             ThemeScrollBarThumbStyle;
  431. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  432. /* Font constants                                                                            */
  433. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  434.  
  435. enum {
  436.     kThemeSystemFont            = 0,
  437.     kThemeSmallSystemFont        = 1,
  438.     kThemeSmallEmphasizedSystemFont = 2,
  439.     kThemeViewsFont                = 3
  440. };
  441.  
  442. typedef UInt16                             ThemeFontID;
  443. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  444. /* Tab constants                                                                            */
  445. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  446.  
  447. enum {
  448.     kThemeTabNonFront            = 0,
  449.     kThemeTabNonFrontPressed    = 1,
  450.     kThemeTabNonFrontInactive    = 2,
  451.     kThemeTabFront                = 3,
  452.     kThemeTabFrontInactive        = 4
  453. };
  454.  
  455. typedef UInt16                             ThemeTabStyle;
  456.  
  457. enum {
  458.     kThemeTabNorth                = 0,
  459.     kThemeTabSouth                = 1,
  460.     kThemeTabEast                = 2,
  461.     kThemeTabWest                = 3
  462. };
  463.  
  464. typedef UInt16                             ThemeTabDirection;
  465. /* NOTE ON TAB HEIGHT                                                                        */
  466. /* Use the kThemeSmallTabHeightMax and kThemeLargeTabHeightMax when calculating the rects    */
  467. /* to draw tabs into. This height includes the tab frame overlap. Tabs that are not in the    */
  468. /* front are only drawn down to where they meet the frame, as if the height was just        */
  469. /* kThemeLargeTabHeight, for example, as opposed to the ...Max constant. Remember that for    */
  470. /* East and West tabs, the height referred to below is actually the width.                    */
  471.  
  472. enum {
  473.     kThemeSmallTabHeight        = 16,                            /* amount small tabs protrude from frame.*/
  474.     kThemeLargeTabHeight        = 21,                            /* amount large tabs protrude from frame.*/
  475.     kThemeTabPaneOverlap        = 3,                            /* amount tabs overlap frame.*/
  476.     kThemeSmallTabHeightMax        = 19,                            /* small tab height + overlap*/
  477.     kThemeLargeTabHeightMax        = 24                            /* large tab height + overlap*/
  478. };
  479.  
  480. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  481. /* Track kinds                                                                                */
  482. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  483.  
  484. enum {
  485.     kThemeScrollBar                = 0,
  486.     kThemeSmallScrollBar        = 1,
  487.     kThemeSlider                = 2,
  488.     kThemeProgressBar            = 3,
  489.     kThemeIndeterminateBar        = 4
  490. };
  491.  
  492. typedef UInt16                             ThemeTrackKind;
  493. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  494. /* Track enable states                                                                        */
  495. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  496.  
  497. enum {
  498.                                                                 /* track states */
  499.     kThemeTrackActive            = 0,
  500.     kThemeTrackDisabled            = 1,
  501.     kThemeTrackNothingToScroll    = 2
  502. };
  503.  
  504. typedef UInt8                             ThemeTrackEnableState;
  505. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  506. /* Track pressed states                                                                        */
  507. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  508.  
  509. enum {
  510.                                                                 /* press states (ignored unless track is active) */
  511.     kThemeLeftOutsideArrowPressed = 0x01,
  512.     kThemeLeftInsideArrowPressed = 0x02,
  513.     kThemeLeftTrackPressed        = 0x04,
  514.     kThemeThumbPressed            = 0x08,
  515.     kThemeRightTrackPressed        = 0x10,
  516.     kThemeRightInsideArrowPressed = 0x20,
  517.     kThemeRightOutsideArrowPressed = 0x40,
  518.     kThemeTopOutsideArrowPressed = kThemeLeftOutsideArrowPressed,
  519.     kThemeTopInsideArrowPressed    = kThemeLeftInsideArrowPressed,
  520.     kThemeTopTrackPressed        = kThemeLeftTrackPressed,
  521.     kThemeBottomTrackPressed    = kThemeRightTrackPressed,
  522.     kThemeBottomInsideArrowPressed = kThemeRightInsideArrowPressed,
  523.     kThemeBottomOutsideArrowPressed = kThemeRightOutsideArrowPressed
  524. };
  525.  
  526. typedef UInt8                             ThemeTrackPressState;
  527. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  528. /* Thumb directions                                                                            */
  529. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  530.  
  531. enum {
  532.                                                                 /* thumb direction */
  533.     kThemeThumbPlain            = 0,
  534.     kThemeThumbUpward            = 1,
  535.     kThemeThumbDownward            = 2
  536. };
  537.  
  538. typedef UInt8                             ThemeThumbDirection;
  539. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  540. /* Track attributes                                                                            */
  541. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  542.  
  543. enum {
  544.     kThemeTrackHorizontal        = (1 << 0),                        /* track is drawn horizontally*/
  545.     kThemeTrackRightToLeft        = (1 << 1),                        /* track progresses from right to left*/
  546.     kThemeTrackShowThumb        = (1 << 2)                        /* track's thumb should be drawn*/
  547. };
  548.  
  549. typedef UInt16                             ThemeTrackAttributes;
  550. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  551. /* Track info block                                                                            */
  552. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  553.  
  554. struct ScrollbarTrackInfo {
  555.     SInt32                             viewsize;                    /* current view range size */
  556.     ThemeTrackPressState             pressState;                    /* pressed parts state */
  557. };
  558. typedef struct ScrollbarTrackInfo        ScrollbarTrackInfo;
  559.  
  560. struct SliderTrackInfo {
  561.     ThemeThumbDirection             thumbDir;                    /* thumb direction */
  562.     ThemeTrackPressState             pressState;                    /* pressed parts state */
  563. };
  564. typedef struct SliderTrackInfo            SliderTrackInfo;
  565.  
  566. struct ProgressTrackInfo {
  567.     UInt8                             phase;                        /* phase for indeterminate progress */
  568. };
  569. typedef struct ProgressTrackInfo        ProgressTrackInfo;
  570.  
  571. struct ThemeTrackDrawInfo {
  572.     ThemeTrackKind                     kind;                        /* what kind of track this info is for */
  573.     Rect                             bounds;                        /* track basis rectangle */
  574.     SInt32                             min;                        /* min track value */
  575.     SInt32                             max;                        /* max track value */
  576.     SInt32                             value;                        /* current thumb value */
  577.     UInt32                             reserved;
  578.  
  579.     ThemeTrackAttributes             attributes;                    /* various track attributes */
  580.     ThemeTrackEnableState             enableState;                /* enable state */
  581.     UInt8                             filler1;
  582.  
  583.     union {
  584.         ScrollbarTrackInfo                 scrollbar;
  585.         SliderTrackInfo                 slider;
  586.         ProgressTrackInfo                 progress;
  587.     }                                 trackInfo;
  588. };
  589. typedef struct ThemeTrackDrawInfo        ThemeTrackDrawInfo;
  590. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  591. /* ThemeWindowAttributes                                                                    */
  592. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  593.  
  594. enum {
  595.     kThemeWindowHasGrow            = (1 << 0),                        /* can the size of the window be changed by the user? */
  596.     kThemeWindowHasHorizontalZoom = (1 << 3),                    /* window can zoom only horizontally */
  597.     kThemeWindowHasVerticalZoom    = (1 << 4),                        /* window can zoom only vertically */
  598.     kThemeWindowHasFullZoom        = kThemeWindowHasHorizontalZoom + kThemeWindowHasVerticalZoom, /* window zooms in all directions */
  599.     kThemeWindowHasCloseBox        = (1 << 5),                        /* window has a close box */
  600.     kThemeWindowHasCollapseBox    = (1 << 6),                        /* window has a collapse box */
  601.     kThemeWindowHasTitleText    = (1 << 7),                        /* window has a title/title icon */
  602.     kThemeWindowIsCollapsed        = (1 << 8)                        /* window is in the collapsed state */
  603. };
  604.  
  605.  
  606. typedef UInt32                             ThemeWindowAttributes;
  607. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  608. /* Window Types Supported by the Appearance Manager                                            */
  609. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  610.  
  611. enum {
  612.     kThemeDocumentWindow        = 0,
  613.     kThemeDialogWindow            = 1,
  614.     kThemeMovableDialogWindow    = 2,
  615.     kThemeAlertWindow            = 3,
  616.     kThemeMovableAlertWindow    = 4,
  617.     kThemePlainDialogWindow        = 5,
  618.     kThemeShadowDialogWindow    = 6,
  619.     kThemePopupWindow            = 7,
  620.     kThemeUtilityWindow            = 8,
  621.     kThemeUtilitySideWindow        = 9
  622. };
  623.  
  624. typedef UInt16                             ThemeWindowType;
  625. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  626. /* Window Widgets Supported by the Appearance Manager                                        */
  627. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  628.  
  629. enum {
  630.     kThemeWidgetCloseBox        = 0,
  631.     kThemeWidgetZoomBox            = 1,
  632.     kThemeWidgetCollapseBox        = 2
  633. };
  634.  
  635. typedef UInt16                             ThemeTitleBarWidget;
  636. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  637. /* Popup arrow orientations                                                                    */
  638. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  639.  
  640. enum {
  641.     kThemeArrowLeft                = 0,
  642.     kThemeArrowDown                = 1,
  643.     kThemeArrowRight            = 2,
  644.     kThemeArrowUp                = 3
  645. };
  646.  
  647. typedef UInt16                             ThemeArrowOrientation;
  648. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  649. /* Popup arrow sizes                                                                        */
  650. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  651.  
  652. enum {
  653.     kThemeArrow3pt                = 0,
  654.     kThemeArrow5pt                = 1,
  655.     kThemeArrow7pt                = 2,
  656.     kThemeArrow9pt                = 3
  657. };
  658.  
  659. typedef UInt16                             ThemePopupArrowSize;
  660. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  661. /* Grow box directions                                                                        */
  662. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  663.  
  664. enum {
  665.     kThemeGrowLeft                = (1 << 0),                        /* can grow to the left */
  666.     kThemeGrowRight                = (1 << 1),                        /* can grow to the right */
  667.     kThemeGrowUp                = (1 << 2),                        /* can grow up */
  668.     kThemeGrowDown                = (1 << 3)                        /* can grow down */
  669. };
  670.  
  671. typedef UInt16                             ThemeGrowDirection;
  672. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  673. /* Button kinds                                                                                */
  674. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  675.  
  676. enum {
  677.     kThemePushButton            = 0,
  678.     kThemeCheckBox                = 1,
  679.     kThemeRadioButton            = 2,
  680.     kThemeBevelButton            = 3,                            /* bevel button (obsolete) */
  681.     kThemeArrowButton            = 4,                            /* popup button without text  (no label) */
  682.     kThemePopupButton            = 5,                            /* popup button */
  683.     kThemeDisclosureButton        = 6,
  684.     kThemeIncDecButton            = 7,                            /* increment/decrement buttons  (no label) */
  685.     kThemeSmallBevelButton        = 8,                            /* small-shadow bevel button */
  686.     kThemeMediumBevelButton        = 3,                            /* med-shadow bevel button */
  687.     kThemeLargeBevelButton        = 9                                /* large-shadow bevel button */
  688. };
  689.  
  690. typedef UInt16                             ThemeButtonKind;
  691. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  692. /* Common button values                                                                        */
  693. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  694.  
  695. enum {
  696.     kThemeButtonOff                = 0,
  697.     kThemeButtonOn                = 1,
  698.     kThemeButtonMixed            = 2,
  699.     kThemeDisclosureRight        = 0,
  700.     kThemeDisclosureDown        = 1,
  701.     kThemeDisclosureLeft        = 2
  702. };
  703.  
  704. typedef UInt16                             ThemeButtonValue;
  705. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  706. /* Button adornment types                                                                    */
  707. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  708.  
  709. enum {
  710.     kThemeAdornmentNone            = 0,
  711.     kThemeAdornmentDefault        = (1 << 0),                        /* if set, draw default ornamentation ( push button only ) */
  712.     kThemeAdornmentFocus        = (1 << 2),                        /* if set, draw focus */
  713.     kThemeAdornmentRightToLeft    = (1 << 4),                        /* if set, draw right to left label */
  714.     kThemeAdornmentDrawIndicatorOnly = (1 << 5)                    /* if set, don't draw or erase label ( radio, check, disclosure ) */
  715. };
  716.  
  717. typedef UInt16                             ThemeButtonAdornment;
  718. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  719. /* Button drawing info block                                                                */
  720. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  721.  
  722. struct ThemeButtonDrawInfo {
  723.     ThemeDrawState                     state;
  724.     ThemeButtonValue                 value;
  725.     ThemeButtonAdornment             adornment;
  726. };
  727. typedef struct ThemeButtonDrawInfo        ThemeButtonDrawInfo;
  728. typedef ThemeButtonDrawInfo *            ThemeButtonDrawInfoPtr;
  729. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  730. /* Sound Support                                                                            */
  731. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  732. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  733. /* Drag Sounds                                                                                */
  734. /*                                                                                            */
  735. /* Drag sounds are looped for the duration of the drag.                                        */
  736. /*                                                                                            */
  737. /* Call BeginThemeDragSound at the start of the drag.                                        */
  738. /* Call EndThemeDragSound when the drag has finished.                                        */
  739. /*                                                                                            */
  740. /* Note that in order to maintain a consistent user experience, only one drag sound may     */
  741. /* occur at a time.  The sound should be attached to a mouse action, start after the         */
  742. /* mouse goes down and stop when the mouse is released.                                        */
  743. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  744.  
  745. enum {
  746.     kThemeDragSoundNone            = 0,
  747.     kThemeDragSoundMoveWindow    = FOUR_CHAR_CODE('wmov'),
  748.     kThemeDragSoundGrowWindow    = FOUR_CHAR_CODE('wgro'),
  749.     kThemeDragSoundMoveUtilWindow = FOUR_CHAR_CODE('umov'),
  750.     kThemeDragSoundGrowUtilWindow = FOUR_CHAR_CODE('ugro'),
  751.     kThemeDragSoundMoveDialog    = FOUR_CHAR_CODE('dmov'),
  752.     kThemeDragSoundMoveAlert    = FOUR_CHAR_CODE('amov'),
  753.     kThemeDragSoundMoveIcon        = FOUR_CHAR_CODE('imov'),
  754.     kThemeDragSoundSliderThumb    = FOUR_CHAR_CODE('slth'),
  755.     kThemeDragSoundSliderGhost    = FOUR_CHAR_CODE('slgh'),
  756.     kThemeDragSoundScrollbarThumb = FOUR_CHAR_CODE('sbth'),
  757.     kThemeDragSoundScrollbarGhost = FOUR_CHAR_CODE('sbgh'),
  758.     kThemeDragSoundScrollbarArrowDecreasing = FOUR_CHAR_CODE('sbad'),
  759.     kThemeDragSoundScrollbarArrowIncreasing = FOUR_CHAR_CODE('sbai'),
  760.     kThemeDragSoundDragging        = FOUR_CHAR_CODE('drag')
  761. };
  762.  
  763.  
  764. typedef OSType                             ThemeDragSoundKind;
  765. /*——————————————————————————————————————————————————————————————————————————*/
  766. /* State-change sounds                                                        */
  767. /*                                                                            */
  768. /* State-change sounds are played asynchonously as a one-shot.                */
  769. /*                                                                            */
  770. /* Call PlayThemeSound to play the sound.  The sound will play                */
  771. /* asynchronously until complete, then stop automatically.                    */
  772. /*——————————————————————————————————————————————————————————————————————————*/
  773.  
  774. enum {
  775.     kThemeSoundNone                = 0,
  776.     kThemeSoundMenuOpen            = FOUR_CHAR_CODE('mnuo'),        /* menu sounds */
  777.     kThemeSoundMenuClose        = FOUR_CHAR_CODE('mnuc'),
  778.     kThemeSoundMenuItemHilite    = FOUR_CHAR_CODE('mnui'),
  779.     kThemeSoundMenuItemRelease    = FOUR_CHAR_CODE('mnus'),
  780.     kThemeSoundWindowClosePress    = FOUR_CHAR_CODE('wclp'),        /* window sounds */
  781.     kThemeSoundWindowCloseEnter    = FOUR_CHAR_CODE('wcle'),
  782.     kThemeSoundWindowCloseExit    = FOUR_CHAR_CODE('wclx'),
  783.     kThemeSoundWindowCloseRelease = FOUR_CHAR_CODE('wclr'),
  784.     kThemeSoundWindowZoomPress    = FOUR_CHAR_CODE('wzmp'),
  785.     kThemeSoundWindowZoomEnter    = FOUR_CHAR_CODE('wzme'),
  786.     kThemeSoundWindowZoomExit    = FOUR_CHAR_CODE('wzmx'),
  787.     kThemeSoundWindowZoomRelease = FOUR_CHAR_CODE('wzmr'),
  788.     kThemeSoundWindowCollapsePress = FOUR_CHAR_CODE('wcop'),
  789.     kThemeSoundWindowCollapseEnter = FOUR_CHAR_CODE('wcoe'),
  790.     kThemeSoundWindowCollapseExit = FOUR_CHAR_CODE('wcox'),
  791.     kThemeSoundWindowCollapseRelease = FOUR_CHAR_CODE('wcor'),
  792.     kThemeSoundWindowDragBoundary = FOUR_CHAR_CODE('wdbd'),
  793.     kThemeSoundUtilWinClosePress = FOUR_CHAR_CODE('uclp'),        /* utility window sounds */
  794.     kThemeSoundUtilWinCloseEnter = FOUR_CHAR_CODE('ucle'),
  795.     kThemeSoundUtilWinCloseExit    = FOUR_CHAR_CODE('uclx'),
  796.     kThemeSoundUtilWinCloseRelease = FOUR_CHAR_CODE('uclr'),
  797.     kThemeSoundUtilWinZoomPress    = FOUR_CHAR_CODE('uzmp'),
  798.     kThemeSoundUtilWinZoomEnter    = FOUR_CHAR_CODE('uzme'),
  799.     kThemeSoundUtilWinZoomExit    = FOUR_CHAR_CODE('uzmx'),
  800.     kThemeSoundUtilWinZoomRelease = FOUR_CHAR_CODE('uzmr'),
  801.     kThemeSoundUtilWinCollapsePress = FOUR_CHAR_CODE('ucop'),
  802.     kThemeSoundUtilWinCollapseEnter = FOUR_CHAR_CODE('ucoe'),
  803.     kThemeSoundUtilWinCollapseExit = FOUR_CHAR_CODE('ucox'),
  804.     kThemeSoundUtilWinCollapseRelease = FOUR_CHAR_CODE('ucor'),
  805.     kThemeSoundUtilWinDragBoundary = FOUR_CHAR_CODE('udbd'),
  806.     kThemeSoundWindowOpen        = FOUR_CHAR_CODE('wopn'),        /* window close and zoom action */
  807.     kThemeSoundWindowClose        = FOUR_CHAR_CODE('wcls'),
  808.     kThemeSoundWindowZoomIn        = FOUR_CHAR_CODE('wzmi'),
  809.     kThemeSoundWindowZoomOut    = FOUR_CHAR_CODE('wzmo'),
  810.     kThemeSoundWindowCollapseUp    = FOUR_CHAR_CODE('wcol'),
  811.     kThemeSoundWindowCollapseDown = FOUR_CHAR_CODE('wexp'),
  812.     kThemeSoundWindowActivate    = FOUR_CHAR_CODE('wact'),
  813.     kThemeSoundUtilWindowOpen    = FOUR_CHAR_CODE('uopn'),
  814.     kThemeSoundUtilWindowClose    = FOUR_CHAR_CODE('ucls'),
  815.     kThemeSoundUtilWindowZoomIn    = FOUR_CHAR_CODE('uzmi'),
  816.     kThemeSoundUtilWindowZoomOut = FOUR_CHAR_CODE('uzmo'),
  817.     kThemeSoundUtilWindowCollapseUp = FOUR_CHAR_CODE('ucol'),
  818.     kThemeSoundUtilWindowCollapseDown = FOUR_CHAR_CODE('uexp'),
  819.     kThemeSoundUtilWindowActivate = FOUR_CHAR_CODE('uact'),
  820.     kThemeSoundDialogOpen        = FOUR_CHAR_CODE('dopn'),
  821.     kThemeSoundDialogClose        = FOUR_CHAR_CODE('dlgc'),
  822.     kThemeSoundAlertOpen        = FOUR_CHAR_CODE('aopn'),
  823.     kThemeSoundAlertClose        = FOUR_CHAR_CODE('altc'),
  824.     kThemeSoundPopupWindowOpen    = FOUR_CHAR_CODE('pwop'),
  825.     kThemeSoundPopupWindowClose    = FOUR_CHAR_CODE('pwcl'),
  826.     kThemeSoundButtonPress        = FOUR_CHAR_CODE('btnp'),        /* button */
  827.     kThemeSoundButtonEnter        = FOUR_CHAR_CODE('btne'),
  828.     kThemeSoundButtonExit        = FOUR_CHAR_CODE('btnx'),
  829.     kThemeSoundButtonRelease    = FOUR_CHAR_CODE('btnr'),
  830.     kThemeSoundDefaultButtonPress = FOUR_CHAR_CODE('dbtp'),        /* default button */
  831.     kThemeSoundDefaultButtonEnter = FOUR_CHAR_CODE('dbte'),
  832.     kThemeSoundDefaultButtonExit = FOUR_CHAR_CODE('dbtx'),
  833.     kThemeSoundDefaultButtonRelease = FOUR_CHAR_CODE('dbtr'),
  834.     kThemeSoundCancelButtonPress = FOUR_CHAR_CODE('cbtp'),        /* cancel button */
  835.     kThemeSoundCancelButtonEnter = FOUR_CHAR_CODE('cbte'),
  836.     kThemeSoundCancelButtonExit    = FOUR_CHAR_CODE('cbtx'),
  837.     kThemeSoundCancelButtonRelease = FOUR_CHAR_CODE('cbtr'),
  838.     kThemeSoundCheckboxPress    = FOUR_CHAR_CODE('chkp'),        /* checkboxes */
  839.     kThemeSoundCheckboxEnter    = FOUR_CHAR_CODE('chke'),
  840.     kThemeSoundCheckboxExit        = FOUR_CHAR_CODE('chkx'),
  841.     kThemeSoundCheckboxRelease    = FOUR_CHAR_CODE('chkr'),
  842.     kThemeSoundRadioPress        = FOUR_CHAR_CODE('radp'),        /* radio buttons */
  843.     kThemeSoundRadioEnter        = FOUR_CHAR_CODE('rade'),
  844.     kThemeSoundRadioExit        = FOUR_CHAR_CODE('radx'),
  845.     kThemeSoundRadioRelease        = FOUR_CHAR_CODE('radr'),
  846.     kThemeSoundScrollArrowPress    = FOUR_CHAR_CODE('sbap'),        /* scrollbars */
  847.     kThemeSoundScrollArrowEnter    = FOUR_CHAR_CODE('sbae'),
  848.     kThemeSoundScrollArrowExit    = FOUR_CHAR_CODE('sbax'),
  849.     kThemeSoundScrollArrowRelease = FOUR_CHAR_CODE('sbar'),
  850.     kThemeSoundScrollEndOfTrack    = FOUR_CHAR_CODE('sbte'),
  851.     kThemeSoundScrollTrackPress    = FOUR_CHAR_CODE('sbtp'),
  852.     kThemeSoundSliderEndOfTrack    = FOUR_CHAR_CODE('slte'),        /* sliders */
  853.     kThemeSoundSliderTrackPress    = FOUR_CHAR_CODE('sltp'),
  854.     kThemeSoundBalloonOpen        = FOUR_CHAR_CODE('blno'),        /* help balloons */
  855.     kThemeSoundBalloonClose        = FOUR_CHAR_CODE('blnc'),
  856.     kThemeSoundBevelPress        = FOUR_CHAR_CODE('bevp'),        /* Bevel buttons */
  857.     kThemeSoundBevelEnter        = FOUR_CHAR_CODE('beve'),
  858.     kThemeSoundBevelExit        = FOUR_CHAR_CODE('bevx'),
  859.     kThemeSoundBevelRelease        = FOUR_CHAR_CODE('bevr'),
  860.     kThemeSoundLittleArrowUpPress = FOUR_CHAR_CODE('laup'),        /* Little Arrows */
  861.     kThemeSoundLittleArrowDnPress = FOUR_CHAR_CODE('ladp'),
  862.     kThemeSoundLittleArrowEnter    = FOUR_CHAR_CODE('lare'),
  863.     kThemeSoundLittleArrowExit    = FOUR_CHAR_CODE('larx'),
  864.     kThemeSoundLittleArrowUpRelease = FOUR_CHAR_CODE('laur'),
  865.     kThemeSoundLittleArrowDnRelease = FOUR_CHAR_CODE('ladr'),
  866.     kThemeSoundPopupPress        = FOUR_CHAR_CODE('popp'),        /* Popup Buttons */
  867.     kThemeSoundPopupEnter        = FOUR_CHAR_CODE('pope'),
  868.     kThemeSoundPopupExit        = FOUR_CHAR_CODE('popx'),
  869.     kThemeSoundPopupRelease        = FOUR_CHAR_CODE('popr'),
  870.     kThemeSoundDisclosurePress    = FOUR_CHAR_CODE('dscp'),        /* Disclosure Buttons */
  871.     kThemeSoundDisclosureEnter    = FOUR_CHAR_CODE('dsce'),
  872.     kThemeSoundDisclosureExit    = FOUR_CHAR_CODE('dscx'),
  873.     kThemeSoundDisclosureRelease = FOUR_CHAR_CODE('dscr'),
  874.     kThemeSoundTabPressed        = FOUR_CHAR_CODE('tabp'),        /* Tabs */
  875.     kThemeSoundTabEnter            = FOUR_CHAR_CODE('tabe'),
  876.     kThemeSoundTabExit            = FOUR_CHAR_CODE('tabx'),
  877.     kThemeSoundTabRelease        = FOUR_CHAR_CODE('tabr'),
  878.     kThemeSoundDragTargetHilite    = FOUR_CHAR_CODE('dthi'),        /* drag manager */
  879.     kThemeSoundDragTargetUnhilite = FOUR_CHAR_CODE('dtuh'),
  880.     kThemeSoundDragTargetDrop    = FOUR_CHAR_CODE('dtdr'),
  881.     kThemeSoundEmptyTrash        = FOUR_CHAR_CODE('ftrs'),        /* finder */
  882.     kThemeSoundSelectItem        = FOUR_CHAR_CODE('fsel'),
  883.     kThemeSoundNewItem            = FOUR_CHAR_CODE('fnew'),
  884.     kThemeSoundReceiveDrop        = FOUR_CHAR_CODE('fdrp'),
  885.     kThemeSoundCopyDone            = FOUR_CHAR_CODE('fcpd'),
  886.     kThemeSoundResolveAlias        = FOUR_CHAR_CODE('fral'),
  887.     kThemeSoundLaunchApp        = FOUR_CHAR_CODE('flap'),
  888.     kThemeSoundDiskInsert        = FOUR_CHAR_CODE('dski'),
  889.     kThemeSoundDiskEject        = FOUR_CHAR_CODE('dske'),
  890.     kThemeSoundFinderDragOnIcon    = FOUR_CHAR_CODE('fdon'),
  891.     kThemeSoundFinderDragOffIcon = FOUR_CHAR_CODE('fdof')
  892. };
  893.  
  894. typedef OSType                             ThemeSoundKind;
  895. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  896. /* Window Metrics                                                                            */
  897. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  898. /*     Window metrics are used by the Appearance manager to fill in the blanks necessary to     */
  899. /*     draw windows. If a value is not appropriate for the type of window, be sure to fill in    */
  900. /*     the slot in the structure with zero.    For the popupTabOffset parameter, you can pass a*/
  901. /*     real value based on the left edge of the window. This value might be interpreted in a     */
  902. /*     different manner when depending on the value of the popupTabPosition field. The values    */
  903. /*     you can pass into popupTabPosition are:                                                    */
  904. /*                                                                                            */
  905. /*    kThemePopupTabNormalPosition                                                            */
  906. /*        Starts the tab left edge at the position indicated by the popupTabOffset field.        */
  907. /*                                                                                            */
  908. /*    kThemePopupTabCenterOnWindow                                                            */
  909. /*        tells us to ignore the offset field and instead simply center the width of the         */
  910. /*        handle on the window.                                                                */
  911. /*                                                                                            */
  912. /*    kThemePopupTabCenterOnOffset                                                            */
  913. /*        tells us to center the width of the handle around the value passed in offset.        */
  914. /*                                                                                            */
  915. /*     The Appearance Manager will try its best to accomodate the requested placement, but may */
  916. /*     move the handle slightly to make it fit correctly.                                        */
  917. /*                                                                                            */
  918.  
  919. enum {
  920.     kThemePopupTabNormalPosition = 0,
  921.     kThemePopupTabCenterOnWindow = 1,
  922.     kThemePopupTabCenterOnOffset = 2
  923. };
  924.  
  925.  
  926. struct ThemeWindowMetrics {
  927.     UInt16                             metricSize;                    /* should be always be sizeof( ThemeWindowMetrics )*/
  928.     SInt16                             titleHeight;
  929.     SInt16                             titleWidth;
  930.     SInt16                             popupTabOffset;
  931.     SInt16                             popupTabWidth;
  932.     UInt16                             popupTabPosition;
  933. };
  934. typedef struct ThemeWindowMetrics        ThemeWindowMetrics;
  935. typedef ThemeWindowMetrics *            ThemeWindowMetricsPtr;
  936. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  937. /* Drawing State                                                                            */
  938. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  939. typedef struct OpaqueThemeDrawingState*  ThemeDrawingState;
  940. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  941. /* Callback procs                                                                            */
  942. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  943. typedef CALLBACK_API( void , ThemeTabTitleDrawProcPtr )(const Rect *bounds, ThemeTabStyle style, ThemeTabDirection direction, SInt16 depth, Boolean isColorDev, UInt32 userData);
  944. typedef CALLBACK_API( void , ThemeEraseProcPtr )(const Rect *bounds, UInt32 eraseData, SInt16 depth, Boolean isColorDev);
  945. typedef CALLBACK_API( void , ThemeButtonDrawProcPtr )(const Rect *bounds, ThemeButtonKind kind, ThemeButtonDrawInfo *info, UInt32 userData, SInt16 depth, Boolean isColorDev);
  946. typedef CALLBACK_API( void , WindowTitleDrawingProcPtr )(const Rect *bounds, SInt16 depth, Boolean colorDevice, UInt32 userData);
  947. typedef CALLBACK_API( Boolean , ThemeIteratorProcPtr )(ConstStr255Param inFileName, SInt16 resID, Collection inThemeSettings, void *inUserData);
  948. typedef STACK_UPP_TYPE(ThemeTabTitleDrawProcPtr)                 ThemeTabTitleDrawUPP;
  949. typedef STACK_UPP_TYPE(ThemeEraseProcPtr)                         ThemeEraseUPP;
  950. typedef STACK_UPP_TYPE(ThemeButtonDrawProcPtr)                     ThemeButtonDrawUPP;
  951. typedef STACK_UPP_TYPE(WindowTitleDrawingProcPtr)                 WindowTitleDrawingUPP;
  952. typedef STACK_UPP_TYPE(ThemeIteratorProcPtr)                     ThemeIteratorUPP;
  953. enum { uppThemeTabTitleDrawProcInfo = 0x00036AC0 };             /* pascal no_return_value Func(4_bytes, 2_bytes, 2_bytes, 2_bytes, 1_byte, 4_bytes) */
  954. enum { uppThemeEraseProcInfo = 0x00001BC0 };                     /* pascal no_return_value Func(4_bytes, 4_bytes, 2_bytes, 1_byte) */
  955. enum { uppThemeButtonDrawProcInfo = 0x0001BEC0 };                 /* pascal no_return_value Func(4_bytes, 2_bytes, 4_bytes, 4_bytes, 2_bytes, 1_byte) */
  956. enum { uppWindowTitleDrawingProcInfo = 0x000036C0 };             /* pascal no_return_value Func(4_bytes, 2_bytes, 1_byte, 4_bytes) */
  957. enum { uppThemeIteratorProcInfo = 0x00003ED0 };                 /* pascal 1_byte Func(4_bytes, 2_bytes, 4_bytes, 4_bytes) */
  958. #define NewThemeTabTitleDrawProc(userRoutine)                     (ThemeTabTitleDrawUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppThemeTabTitleDrawProcInfo, GetCurrentArchitecture())
  959. #define NewThemeEraseProc(userRoutine)                             (ThemeEraseUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppThemeEraseProcInfo, GetCurrentArchitecture())
  960. #define NewThemeButtonDrawProc(userRoutine)                     (ThemeButtonDrawUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppThemeButtonDrawProcInfo, GetCurrentArchitecture())
  961. #define NewWindowTitleDrawingProc(userRoutine)                     (WindowTitleDrawingUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppWindowTitleDrawingProcInfo, GetCurrentArchitecture())
  962. #define NewThemeIteratorProc(userRoutine)                         (ThemeIteratorUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppThemeIteratorProcInfo, GetCurrentArchitecture())
  963. #define CallThemeTabTitleDrawProc(userRoutine, bounds, style, direction, depth, isColorDev, userData)  CALL_SIX_PARAMETER_UPP((userRoutine), uppThemeTabTitleDrawProcInfo, (bounds), (style), (direction), (depth), (isColorDev), (userData))
  964. #define CallThemeEraseProc(userRoutine, bounds, eraseData, depth, isColorDev)  CALL_FOUR_PARAMETER_UPP((userRoutine), uppThemeEraseProcInfo, (bounds), (eraseData), (depth), (isColorDev))
  965. #define CallThemeButtonDrawProc(userRoutine, bounds, kind, info, userData, depth, isColorDev)  CALL_SIX_PARAMETER_UPP((userRoutine), uppThemeButtonDrawProcInfo, (bounds), (kind), (info), (userData), (depth), (isColorDev))
  966. #define CallWindowTitleDrawingProc(userRoutine, bounds, depth, colorDevice, userData)  CALL_FOUR_PARAMETER_UPP((userRoutine), uppWindowTitleDrawingProcInfo, (bounds), (depth), (colorDevice), (userData))
  967. #define CallThemeIteratorProc(userRoutine, inFileName, resID, inThemeSettings, inUserData)  CALL_FOUR_PARAMETER_UPP((userRoutine), uppThemeIteratorProcInfo, (inFileName), (resID), (inThemeSettings), (inUserData))
  968. /*——————————————————————————————————————————————————————————————————————————————————*/
  969. /* Menu Drawing callbacks                                                            */
  970. /*——————————————————————————————————————————————————————————————————————————————————*/
  971. typedef CALLBACK_API( void , MenuTitleDrawingProcPtr )(const Rect *inBounds, SInt16 inDepth, Boolean inIsColorDevice, SInt32 inUserData);
  972. typedef CALLBACK_API( void , MenuItemDrawingProcPtr )(const Rect *inBounds, SInt16 inDepth, Boolean inIsColorDevice, SInt32 inUserData);
  973. typedef STACK_UPP_TYPE(MenuTitleDrawingProcPtr)                 MenuTitleDrawingUPP;
  974. typedef STACK_UPP_TYPE(MenuItemDrawingProcPtr)                     MenuItemDrawingUPP;
  975. enum { uppMenuTitleDrawingProcInfo = 0x000036C0 };                 /* pascal no_return_value Func(4_bytes, 2_bytes, 1_byte, 4_bytes) */
  976. enum { uppMenuItemDrawingProcInfo = 0x000036C0 };                 /* pascal no_return_value Func(4_bytes, 2_bytes, 1_byte, 4_bytes) */
  977. #define NewMenuTitleDrawingProc(userRoutine)                     (MenuTitleDrawingUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMenuTitleDrawingProcInfo, GetCurrentArchitecture())
  978. #define NewMenuItemDrawingProc(userRoutine)                     (MenuItemDrawingUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMenuItemDrawingProcInfo, GetCurrentArchitecture())
  979. #define CallMenuTitleDrawingProc(userRoutine, inBounds, inDepth, inIsColorDevice, inUserData)  CALL_FOUR_PARAMETER_UPP((userRoutine), uppMenuTitleDrawingProcInfo, (inBounds), (inDepth), (inIsColorDevice), (inUserData))
  980. #define CallMenuItemDrawingProc(userRoutine, inBounds, inDepth, inIsColorDevice, inUserData)  CALL_FOUR_PARAMETER_UPP((userRoutine), uppMenuItemDrawingProcInfo, (inBounds), (inDepth), (inIsColorDevice), (inUserData))
  981. /*——————————————————————————————————————————————————————————————————————————————————*/
  982. /*    Appearance Manager APIs                                                            */
  983. /*——————————————————————————————————————————————————————————————————————————————————*/
  984. /* Registering Appearance-Savvy Applications */
  985. EXTERN_API( OSStatus )
  986. RegisterAppearanceClient        (void)                                                        THREEWORDINLINE(0x303C, 0x0015, 0xAA74);
  987.  
  988. EXTERN_API( OSStatus )
  989. UnregisterAppearanceClient        (void)                                                        THREEWORDINLINE(0x303C, 0x0016, 0xAA74);
  990.  
  991. EXTERN_API( Boolean )
  992. IsAppearanceClient                (const ProcessSerialNumber * process)                        THREEWORDINLINE(0x303C, 0xFFFF, 0xAA74);
  993.  
  994. /*****************************************************************************
  995.     NOTES ON THEME BRUSHES
  996.     Theme brushes can be either colors or patterns, depending on the theme.
  997.     Because of this, you should be prepared to handle the case where a brush
  998.     is a pattern and save and restore the pnPixPat and bkPixPat fields of
  999.     your GrafPorts when saving the fore and back colors. Also, since patterns
  1000.     in bkPixPat override the background color of the window, you should use
  1001.     BackPat to set your background pattern to a normal white pattern. This
  1002.     will ensure that you can use RGBBackColor to set your back color to white,
  1003.     call EraseRect and get the expected results.
  1004. *****************************************************************************/
  1005.  
  1006. EXTERN_API( OSStatus )
  1007. SetThemePen                        (ThemeBrush             inBrush,
  1008.                                  SInt16                 inDepth,
  1009.                                  Boolean                 inIsColorDevice)                    THREEWORDINLINE(0x303C, 0x0001, 0xAA74);
  1010.  
  1011. EXTERN_API( OSStatus )
  1012. SetThemeBackground                (ThemeBrush             inBrush,
  1013.                                  SInt16                 inDepth,
  1014.                                  Boolean                 inIsColorDevice)                    THREEWORDINLINE(0x303C, 0x0002, 0xAA74);
  1015.  
  1016. EXTERN_API( OSStatus )
  1017. SetThemeTextColor                (ThemeTextColor         inColor,
  1018.                                  SInt16                 inDepth,
  1019.                                  Boolean                 inIsColorDevice)                    THREEWORDINLINE(0x303C, 0x0003, 0xAA74);
  1020.  
  1021. EXTERN_API( OSStatus )
  1022. SetThemeWindowBackground        (WindowPtr                 inWindow,
  1023.                                  ThemeBrush             inBrush,
  1024.                                  Boolean                 inUpdate)                            THREEWORDINLINE(0x303C, 0x0004, 0xAA74);
  1025.  
  1026. /* Window Placards, Headers and Frames */
  1027. EXTERN_API( OSStatus )
  1028. DrawThemeWindowHeader            (const Rect *            inRect,
  1029.                                  ThemeDrawState         inState)                            THREEWORDINLINE(0x303C, 0x0005, 0xAA74);
  1030.  
  1031. EXTERN_API( OSStatus )
  1032. DrawThemeWindowListViewHeader    (const Rect *            inRect,
  1033.                                  ThemeDrawState         inState)                            THREEWORDINLINE(0x303C, 0x0006, 0xAA74);
  1034.  
  1035. EXTERN_API( OSStatus )
  1036. DrawThemePlacard                (const Rect *            inRect,
  1037.                                  ThemeDrawState         inState)                            THREEWORDINLINE(0x303C, 0x0007, 0xAA74);
  1038.  
  1039. EXTERN_API( OSStatus )
  1040. DrawThemeEditTextFrame            (const Rect *            inRect,
  1041.                                  ThemeDrawState         inState)                            THREEWORDINLINE(0x303C, 0x0009, 0xAA74);
  1042.  
  1043. EXTERN_API( OSStatus )
  1044. DrawThemeListBoxFrame            (const Rect *            inRect,
  1045.                                  ThemeDrawState         inState)                            THREEWORDINLINE(0x303C, 0x000A, 0xAA74);
  1046.  
  1047. /* Keyboard Focus Drawing */
  1048. EXTERN_API( OSStatus )
  1049. DrawThemeFocusRect                (const Rect *            inRect,
  1050.                                  Boolean                 inHasFocus)                            THREEWORDINLINE(0x303C, 0x000B, 0xAA74);
  1051.  
  1052. /* Dialog Group Boxes and Separators */
  1053. EXTERN_API( OSStatus )
  1054. DrawThemePrimaryGroup            (const Rect *            inRect,
  1055.                                  ThemeDrawState         inState)                            THREEWORDINLINE(0x303C, 0x000C, 0xAA74);
  1056.  
  1057. EXTERN_API( OSStatus )
  1058. DrawThemeSecondaryGroup            (const Rect *            inRect,
  1059.                                  ThemeDrawState         inState)                            THREEWORDINLINE(0x303C, 0x000D, 0xAA74);
  1060.  
  1061. EXTERN_API( OSStatus )
  1062. DrawThemeSeparator                (const Rect *            inRect,
  1063.                                  ThemeDrawState         inState)                            THREEWORDINLINE(0x303C, 0x000E, 0xAA74);
  1064.  
  1065. /*—————————————————————————————— BEGIN APPEARANCE 1.0.1 ————————————————————————————————————————————*/
  1066. /* The following Appearance Manager APIs are only available */
  1067. /* in Appearance 1.0.1 or later                             */
  1068. EXTERN_API( OSStatus )
  1069. DrawThemeModelessDialogFrame    (const Rect *            inRect,
  1070.                                  ThemeDrawState         inState)                            THREEWORDINLINE(0x303C, 0x0008, 0xAA74);
  1071.  
  1072. EXTERN_API( OSStatus )
  1073. DrawThemeGenericWell            (const Rect *            inRect,
  1074.                                  ThemeDrawState         inState,
  1075.                                  Boolean                 inFillCenter)                        THREEWORDINLINE(0x303C, 0x0022, 0xAA74);
  1076.  
  1077. EXTERN_API( OSStatus )
  1078. DrawThemeFocusRegion            (RgnHandle                 inRegion,
  1079.                                  Boolean                 inHasFocus)                            THREEWORDINLINE(0x303C, 0x0023, 0xAA74);
  1080.  
  1081. EXTERN_API( Boolean )
  1082. IsThemeInColor                    (SInt16                 inDepth,
  1083.                                  Boolean                 inIsColorDevice)                    THREEWORDINLINE(0x303C, 0x0024, 0xAA74);
  1084.  
  1085. /* IMPORTANT: GetThemeAccentColors will only work in the platinum theme. Any other theme will */
  1086. /* most likely return an error */
  1087. EXTERN_API( OSStatus )
  1088. GetThemeAccentColors            (CTabHandle *            outColors)                            THREEWORDINLINE(0x303C, 0x0025, 0xAA74);
  1089.  
  1090. EXTERN_API( OSStatus )
  1091. DrawThemeMenuBarBackground        (const Rect *            inBounds,
  1092.                                  ThemeMenuBarState         inState,
  1093.                                  UInt32                 inAttributes)                        THREEWORDINLINE(0x303C, 0x0018, 0xAA74);
  1094.  
  1095. EXTERN_API( OSStatus )
  1096. DrawThemeMenuTitle                (const Rect *            inMenuBarRect,
  1097.                                  const Rect *            inTitleRect,
  1098.                                  ThemeMenuState         inState,
  1099.                                  UInt32                 inAttributes,
  1100.                                  MenuTitleDrawingUPP     inTitleProc,
  1101.                                  UInt32                 inTitleData)                        THREEWORDINLINE(0x303C, 0x0019, 0xAA74);
  1102.  
  1103. EXTERN_API( OSStatus )
  1104. GetThemeMenuBarHeight            (SInt16 *                outHeight)                            THREEWORDINLINE(0x303C, 0x001A, 0xAA74);
  1105.  
  1106. EXTERN_API( OSStatus )
  1107. DrawThemeMenuBackground            (const Rect *            inMenuRect,
  1108.                                  ThemeMenuType             inMenuType)                            THREEWORDINLINE(0x303C, 0x001B, 0xAA74);
  1109.  
  1110. EXTERN_API( OSStatus )
  1111. GetThemeMenuBackgroundRegion    (const Rect *            inMenuRect,
  1112.                                  ThemeMenuType             menuType,
  1113.                                  RgnHandle                 region)                                THREEWORDINLINE(0x303C, 0x001C, 0xAA74);
  1114.  
  1115. EXTERN_API( OSStatus )
  1116. DrawThemeMenuItem                (const Rect *            inMenuRect,
  1117.                                  const Rect *            inItemRect,
  1118.                                  SInt16                 inVirtualMenuTop,
  1119.                                  SInt16                 inVirtualMenuBottom,
  1120.                                  ThemeMenuState         inState,
  1121.                                  ThemeMenuItemType         inItemType,
  1122.                                  MenuItemDrawingUPP     inDrawProc,
  1123.                                  UInt32                 inUserData)                            THREEWORDINLINE(0x303C, 0x001D, 0xAA74);
  1124.  
  1125. EXTERN_API( OSStatus )
  1126. DrawThemeMenuSeparator            (const Rect *            inItemRect)                            THREEWORDINLINE(0x303C, 0x001E, 0xAA74);
  1127.  
  1128. EXTERN_API( OSStatus )
  1129. GetThemeMenuSeparatorHeight        (SInt16 *                outHeight)                            THREEWORDINLINE(0x303C, 0x001F, 0xAA74);
  1130.  
  1131. EXTERN_API( OSStatus )
  1132. GetThemeMenuItemExtra            (ThemeMenuItemType         inItemType,
  1133.                                  SInt16 *                outHeight,
  1134.                                  SInt16 *                outWidth)                            THREEWORDINLINE(0x303C, 0x0020, 0xAA74);
  1135.  
  1136. EXTERN_API( OSStatus )
  1137. GetThemeMenuTitleExtra            (SInt16 *                outWidth,
  1138.                                  Boolean                 inIsSquished)                        THREEWORDINLINE(0x303C, 0x0021, 0xAA74);
  1139.  
  1140. /*——————————————————————————————— BEGIN APPEARANCE 1.1 —————————————————————————————————————————————*/
  1141. /*—————————————————————————————————— THEME SWITCHING ———————————————————————————————————————————————*/
  1142. EXTERN_API( OSStatus )
  1143. GetTheme                        (Collection             ioCollection);
  1144.  
  1145. EXTERN_API( OSStatus )
  1146. SetTheme                        (Collection             ioCollection);
  1147.  
  1148. EXTERN_API( OSStatus )
  1149. IterateThemes                    (ThemeIteratorUPP         inProc,
  1150.                                  void *                    inUserData);
  1151.  
  1152. /*———————————————————————————————————————— TABS ————————————————————————————————————————————————————*/
  1153. EXTERN_API( OSStatus )
  1154. DrawThemeTabPane                (const Rect *            inRect,
  1155.                                  ThemeDrawState         inState);
  1156.  
  1157. EXTERN_API( OSStatus )
  1158. DrawThemeTab                    (const Rect *            inRect,
  1159.                                  ThemeTabStyle             inStyle,
  1160.                                  ThemeTabDirection         inDirection,
  1161.                                  ThemeTabTitleDrawUPP     labelProc,
  1162.                                  UInt32                 userData);
  1163.  
  1164. EXTERN_API( OSStatus )
  1165. GetThemeTabRegion                (const Rect *            inRect,
  1166.                                  ThemeTabStyle             inStyle,
  1167.                                  ThemeTabDirection         inDirection,
  1168.                                  RgnHandle                 ioRgn);
  1169.  
  1170. /*——————————————————————————————————————— CURSORS ——————————————————————————————————————————————————*/
  1171. EXTERN_API( OSStatus )
  1172. SetThemeCursor                    (ThemeCursor             inCursor);
  1173.  
  1174. EXTERN_API( OSStatus )
  1175. SetAnimatedThemeCursor            (ThemeCursor             inCursor,
  1176.                                  UInt32                 inAnimationStep);
  1177.  
  1178. /*———————————————————————————————— CONTROL STYLE SETTINGS ——————————————————————————————————————————*/
  1179. EXTERN_API( OSStatus )
  1180. GetThemeScrollBarThumbStyle        (ThemeScrollBarThumbStyle * outStyle);
  1181.  
  1182. EXTERN_API( OSStatus )
  1183. GetThemeScrollBarArrowStyle        (ThemeScrollBarArrowStyle * outStyle);
  1184.  
  1185. EXTERN_API( OSStatus )
  1186. GetThemeCheckBoxStyle            (ThemeCheckBoxStyle *    outStyle);
  1187.  
  1188. /*———————————————————————————————————————— FONTS ———————————————————————————————————————————————————*/
  1189. EXTERN_API( OSStatus )
  1190. UseThemeFont                    (ThemeFontID             inFontID,
  1191.                                  ScriptCode             inScript);
  1192.  
  1193. EXTERN_API( OSStatus )
  1194. GetThemeFont                    (ThemeFontID             inFontID,
  1195.                                  ScriptCode             inScript,
  1196.                                  StringPtr                 outFontName,
  1197.                                  SInt16 *                outFontSize,
  1198.                                  Style *                outStyle);
  1199.  
  1200. /*———————————————————————————————————————— TRACKS ——————————————————————————————————————————————————*/
  1201. EXTERN_API( OSStatus )
  1202. DrawThemeTrack                    (const ThemeTrackDrawInfo * drawInfo,
  1203.                                  RgnHandle                 rgnGhost,
  1204.                                  ThemeEraseUPP             eraseProc,
  1205.                                  UInt32                 eraseData);
  1206.  
  1207. EXTERN_API( Boolean )
  1208. HitTestThemeTrack                (const ThemeTrackDrawInfo * drawInfo,
  1209.                                  Point                     mousePoint,
  1210.                                  ControlPartCode *        partHit);
  1211.  
  1212. EXTERN_API( OSStatus )
  1213. GetThemeTrackBounds                (const ThemeTrackDrawInfo * drawInfo,
  1214.                                  Rect *                    bounds);
  1215.  
  1216. EXTERN_API( OSStatus )
  1217. GetThemeTrackThumbRgn            (const ThemeTrackDrawInfo * drawInfo,
  1218.                                  RgnHandle                 thumbRgn);
  1219.  
  1220. EXTERN_API( OSStatus )
  1221. GetThemeTrackDragRect            (const ThemeTrackDrawInfo * drawInfo,
  1222.                                  Rect *                    dragRect);
  1223.  
  1224. EXTERN_API( OSStatus )
  1225. DrawThemeTrackTickMarks            (const ThemeTrackDrawInfo * drawInfo,
  1226.                                  ItemCount                 numTicks,
  1227.                                  ThemeEraseUPP             eraseProc,
  1228.                                  UInt32                 eraseData);
  1229.  
  1230. EXTERN_API( OSStatus )
  1231. GetThemeTrackThumbPositionFromOffset (const ThemeTrackDrawInfo * drawInfo,
  1232.                                  Point                     thumbOffset,
  1233.                                  SInt32 *                relativePosition);
  1234.  
  1235. EXTERN_API( OSStatus )
  1236. GetThemeTrackThumbPositionFromRegion (const ThemeTrackDrawInfo * drawInfo,
  1237.                                  RgnHandle                 thumbRgn,
  1238.                                  SInt32 *                relativePosition);
  1239.  
  1240. EXTERN_API( OSStatus )
  1241. GetThemeTrackLiveValue            (const ThemeTrackDrawInfo * drawInfo,
  1242.                                  SInt32                 relativePosition,
  1243.                                  SInt32 *                value);
  1244.  
  1245. /*——————————————————————————————————— SCROLLBAR ARROWS —————————————————————————————————————————————*/
  1246. EXTERN_API( OSStatus )
  1247. DrawThemeScrollbarArrows        (const Rect *            bounds,
  1248.                                  ThemeTrackEnableState     enableState,
  1249.                                  ThemeTrackPressState     pressState,
  1250.                                  Boolean                 isHoriz,
  1251.                                  Rect *                    trackBounds);
  1252.  
  1253. EXTERN_API( OSStatus )
  1254. GetThemeScrollbarTrackRect        (const Rect *            bounds,
  1255.                                  ThemeTrackEnableState     enableState,
  1256.                                  ThemeTrackPressState     pressState,
  1257.                                  Boolean                 isHoriz,
  1258.                                  Rect *                    trackBounds);
  1259.  
  1260. EXTERN_API( Boolean )
  1261. HitTestThemeScrollbarArrows        (const Rect *            scrollbarBounds,
  1262.                                  ThemeTrackEnableState     enableState,
  1263.                                  ThemeTrackPressState     pressState,
  1264.                                  Boolean                 isHoriz,
  1265.                                  Point                     ptHit,
  1266.                                  Rect *                    trackBounds,
  1267.                                  ControlPartCode *        partcode);
  1268.  
  1269. /*———————————————————————————————————————— WINDOWS —————————————————————————————————————————————————*/
  1270. EXTERN_API( OSStatus )
  1271. GetThemeWindowRegion            (ThemeWindowType         flavor,
  1272.                                  const Rect *            contRect,
  1273.                                  ThemeDrawState         state,
  1274.                                  const ThemeWindowMetrics * metrics,
  1275.                                  ThemeWindowAttributes     attributes,
  1276.                                  WindowRegionCode         winRegion,
  1277.                                  RgnHandle                 rgn);
  1278.  
  1279. EXTERN_API( OSStatus )
  1280. DrawThemeWindowFrame            (ThemeWindowType         flavor,
  1281.                                  const Rect *            contRect,
  1282.                                  ThemeDrawState         state,
  1283.                                  const ThemeWindowMetrics * metrics,
  1284.                                  ThemeWindowAttributes     attributes,
  1285.                                  WindowTitleDrawingUPP     titleProc,
  1286.                                  UInt32                 titleData);
  1287.  
  1288. EXTERN_API( OSStatus )
  1289. DrawThemeTitleBarWidget            (ThemeWindowType         flavor,
  1290.                                  const Rect *            contRect,
  1291.                                  ThemeDrawState         state,
  1292.                                  const ThemeWindowMetrics * metrics,
  1293.                                  ThemeWindowAttributes     attributes,
  1294.                                  ThemeTitleBarWidget     widget);
  1295.  
  1296. EXTERN_API( Boolean )
  1297. GetThemeWindowRegionHit            (ThemeWindowType         flavor,
  1298.                                  const Rect *            inContRect,
  1299.                                  ThemeDrawState         state,
  1300.                                  const ThemeWindowMetrics * metrics,
  1301.                                  ThemeWindowAttributes     inAttributes,
  1302.                                  Point                     inPoint,
  1303.                                  WindowRegionCode *        outRegionHit);
  1304.  
  1305. EXTERN_API( OSStatus )
  1306. DrawThemeScrollBarDelimiters    (ThemeWindowType         flavor,
  1307.                                  const Rect *            inContRect,
  1308.                                  ThemeDrawState         state,
  1309.                                  ThemeWindowAttributes     attributes);
  1310.  
  1311. /*———————————————————————————————————————— BUTTONS —————————————————————————————————————————————————*/
  1312. EXTERN_API( OSStatus )
  1313. DrawThemeButton                    (const Rect *            inBounds,
  1314.                                  ThemeButtonKind         inKind,
  1315.                                  const ThemeButtonDrawInfo * inNewInfo,
  1316.                                  const ThemeButtonDrawInfo * inPrevInfo,
  1317.                                  ThemeEraseUPP             inEraseProc,
  1318.                                  ThemeButtonDrawUPP     inLabelProc,
  1319.                                  UInt32                 inUserData);
  1320.  
  1321. EXTERN_API( OSStatus )
  1322. GetThemeButtonRegion            (const Rect *            inBounds,
  1323.                                  ThemeButtonKind         inKind,
  1324.                                  const ThemeButtonDrawInfo * inNewInfo,
  1325.                                  RgnHandle                 outRegion);
  1326.  
  1327. EXTERN_API( OSStatus )
  1328. GetThemeButtonContentBounds        (const Rect *            inBounds,
  1329.                                  ThemeButtonKind         inKind,
  1330.                                  const ThemeButtonDrawInfo * inDrawInfo,
  1331.                                  Rect *                    outBounds);
  1332.  
  1333. EXTERN_API( OSStatus )
  1334. GetThemeButtonBackgroundBounds    (const Rect *            inBounds,
  1335.                                  ThemeButtonKind         inKind,
  1336.                                  const ThemeButtonDrawInfo * inDrawInfo,
  1337.                                  Rect *                    outBounds);
  1338.  
  1339.  
  1340. /*————————————————————————————————————— INTERFACE SOUNDS ———————————————————————————————————————————*/
  1341. EXTERN_API( OSStatus )
  1342. PlayThemeSound                    (ThemeSoundKind         kind)                                THREEWORDINLINE(0x303C, 0x0026, 0xAA74);
  1343.  
  1344. EXTERN_API( OSStatus )
  1345. BeginThemeDragSound                (ThemeDragSoundKind     kind)                                THREEWORDINLINE(0x303C, 0x0027, 0xAA74);
  1346.  
  1347. EXTERN_API( OSStatus )
  1348. EndThemeDragSound                (void)                                                        THREEWORDINLINE(0x303C, 0x0028, 0xAA74);
  1349.  
  1350. /*—————————————————————————————————————— PRIMITIVES ————————————————————————————————————————————————*/
  1351. EXTERN_API( OSStatus )
  1352. DrawThemeTickMark                (const Rect *            bounds,
  1353.                                  ThemeDrawState         state);
  1354.  
  1355. EXTERN_API( OSStatus )
  1356. DrawThemeChasingArrows            (const Rect *            bounds,
  1357.                                  UInt32                 index,
  1358.                                  ThemeDrawState         state,
  1359.                                  ThemeEraseUPP             eraseProc,
  1360.                                  UInt32                 eraseData);
  1361.  
  1362. EXTERN_API( OSStatus )
  1363. DrawThemePopupArrow                (const Rect *            bounds,
  1364.                                  ThemeArrowOrientation     orientation,
  1365.                                  ThemePopupArrowSize     size,
  1366.                                  ThemeDrawState         state,
  1367.                                  ThemeEraseUPP             eraseProc,
  1368.                                  UInt32                 eraseData);
  1369.  
  1370. EXTERN_API( OSStatus )
  1371. DrawThemeStandaloneGrowBox        (Point                     origin,
  1372.                                  ThemeGrowDirection     growDirection,
  1373.                                  Boolean                 isSmall,
  1374.                                  ThemeDrawState         state);
  1375.  
  1376. EXTERN_API( OSStatus )
  1377. DrawThemeStandaloneNoGrowBox    (Point                     origin,
  1378.                                  ThemeGrowDirection     growDirection,
  1379.                                  Boolean                 isSmall,
  1380.                                  ThemeDrawState         state);
  1381.  
  1382. EXTERN_API( OSStatus )
  1383. GetThemeStandaloneGrowBoxBounds    (Point                     origin,
  1384.                                  ThemeGrowDirection     growDirection,
  1385.                                  Boolean                 isSmall,
  1386.                                  Rect *                    bounds);
  1387.  
  1388. /*————————————————————————————————————— DRAWING STATE ——————————————————————————————————————————————*/
  1389. /* The following routines help you save and restore the drawing state in a theme-savvy manner. With    */
  1390. /* these weapons in your arsenal, there is no grafport you cannot tame.    Use ThemeGetDrawingState to    */
  1391. /* get the current drawing settings for the current port. It will return an opaque object for you     */
  1392. /* to pass into ThemeSetDrawingState later on. When you are finished with the state, call the        */
  1393. /* ThemeDisposeDrawingState routine. You can alternatively pass true into the inDisposeNow             */
  1394. /* parameter of the ThemeSetDrawingState routine.  You can use this routine to copy the drawing        */
  1395. /* state from one port to another as well.                                                            */
  1396. EXTERN_API( OSStatus )
  1397. NormalizeThemeDrawingState        (void);
  1398.  
  1399. EXTERN_API( OSStatus )
  1400. GetThemeDrawingState            (ThemeDrawingState *    outState);
  1401.  
  1402. EXTERN_API( OSStatus )
  1403. SetThemeDrawingState            (ThemeDrawingState         inState,
  1404.                                  Boolean                 inDisposeNow);
  1405.  
  1406. EXTERN_API( OSStatus )
  1407. DisposeThemeDrawingState        (ThemeDrawingState         inState);
  1408.  
  1409. /*————————————————————————————————————— MISCELLANEOUS ——————————————————————————————————————————————*/
  1410. /* ApplyThemeBackground is used to set up the background for embedded controls     */
  1411. /* It is normally called by controls that are embedders. The standard controls    */
  1412. /* call this API to ensure a correct background for the current theme. You pass */
  1413. /* in the same rectangle you would if you were calling the drawing primitive.    */
  1414. EXTERN_API( OSStatus )
  1415. ApplyThemeBackground            (ThemeBackgroundKind     inKind,
  1416.                                  const Rect *            bounds,
  1417.                                  ThemeDrawState         inState,
  1418.                                  SInt16                 inDepth,
  1419.                                  Boolean                 inColorDev);
  1420.  
  1421. EXTERN_API( OSStatus )
  1422. SetThemeTextColorForWindow        (WindowPtr                 window,
  1423.                                  Boolean                 isActive,
  1424.                                  SInt16                 depth,
  1425.                                  Boolean                 isColorDev);
  1426.  
  1427. EXTERN_API( Boolean )
  1428. IsValidThemeFileType            (OSType                 fileType);
  1429.  
  1430. EXTERN_API( OSStatus )
  1431. GetThemeBrushAsColor            (ThemeBrush             inBrush,
  1432.                                  SInt16                 inDepth,
  1433.                                  Boolean                 inColorDev,
  1434.                                  RGBColor *                outColor);
  1435.  
  1436. EXTERN_API( OSStatus )
  1437. GetThemeTextColor                (ThemeTextColor         inColor,
  1438.                                  SInt16                 inDepth,
  1439.                                  Boolean                 inColorDev,
  1440.                                  RGBColor *                outColor);
  1441.  
  1442. /*——————————————————————————————————————————————————————————————————————————————————————————————————*/
  1443. /* Obsolete symbolic names                                                                            */
  1444. /*——————————————————————————————————————————————————————————————————————————————————————————————————*/
  1445. /* Obsolete error codes - use the new ones, s'il vous plait / kudasai */
  1446.  
  1447. enum {
  1448.     appearanceBadBrushIndexErr    = themeInvalidBrushErr,            /* pattern index invalid */
  1449.     appearanceProcessRegisteredErr = themeProcessRegisteredErr,
  1450.     appearanceProcessNotRegisteredErr = themeProcessNotRegisteredErr,
  1451.     appearanceBadTextColorIndexErr = themeBadTextColorErr,
  1452.     appearanceThemeHasNoAccents    = themeHasNoAccentsErr,
  1453.     appearanceBadCursorIndexErr    = themeBadCursorIndexErr
  1454. };
  1455.  
  1456.  
  1457. enum {
  1458.     kThemeActiveDialogBackgroundBrush = kThemeBrushDialogBackgroundActive,
  1459.     kThemeInactiveDialogBackgroundBrush = kThemeBrushDialogBackgroundInactive,
  1460.     kThemeActiveAlertBackgroundBrush = kThemeBrushAlertBackgroundActive,
  1461.     kThemeInactiveAlertBackgroundBrush = kThemeBrushAlertBackgroundInactive,
  1462.     kThemeActiveModelessDialogBackgroundBrush = kThemeBrushModelessDialogBackgroundActive,
  1463.     kThemeInactiveModelessDialogBackgroundBrush = kThemeBrushModelessDialogBackgroundInactive,
  1464.     kThemeActiveUtilityWindowBackgroundBrush = kThemeBrushUtilityWindowBackgroundActive,
  1465.     kThemeInactiveUtilityWindowBackgroundBrush = kThemeBrushUtilityWindowBackgroundInactive,
  1466.     kThemeListViewSortColumnBackgroundBrush = kThemeBrushListViewSortColumnBackground,
  1467.     kThemeListViewBackgroundBrush = kThemeBrushListViewBackground,
  1468.     kThemeIconLabelBackgroundBrush = kThemeBrushIconLabelBackground,
  1469.     kThemeListViewSeparatorBrush = kThemeBrushListViewSeparator,
  1470.     kThemeChasingArrowsBrush    = kThemeBrushChasingArrows,
  1471.     kThemeDragHiliteBrush        = kThemeBrushDragHilite,
  1472.     kThemeDocumentWindowBackgroundBrush = kThemeBrushDocumentWindowBackground,
  1473.     kThemeFinderWindowBackgroundBrush = kThemeBrushFinderWindowBackground
  1474. };
  1475.  
  1476.  
  1477. enum {
  1478.     kThemeActiveScrollBarDelimiterBrush = kThemeBrushScrollBarDelimiterActive,
  1479.     kThemeInactiveScrollBarDelimiterBrush = kThemeBrushScrollBarDelimiterInactive,
  1480.     kThemeFocusHighlightBrush    = kThemeBrushFocusHighlight,
  1481.     kThemeActivePopupArrowBrush    = kThemeBrushPopupArrowActive,
  1482.     kThemePressedPopupArrowBrush = kThemeBrushPopupArrowPressed,
  1483.     kThemeInactivePopupArrowBrush = kThemeBrushPopupArrowInactive,
  1484.     kThemeAppleGuideCoachmarkBrush = kThemeBrushAppleGuideCoachmark
  1485. };
  1486.  
  1487.  
  1488. enum {
  1489.     kThemeActiveDialogTextColor    = kThemeTextColorDialogActive,
  1490.     kThemeInactiveDialogTextColor = kThemeTextColorDialogInactive,
  1491.     kThemeActiveAlertTextColor    = kThemeTextColorAlertActive,
  1492.     kThemeInactiveAlertTextColor = kThemeTextColorAlertInactive,
  1493.     kThemeActiveModelessDialogTextColor = kThemeTextColorModelessDialogActive,
  1494.     kThemeInactiveModelessDialogTextColor = kThemeTextColorModelessDialogInactive,
  1495.     kThemeActiveWindowHeaderTextColor = kThemeTextColorWindowHeaderActive,
  1496.     kThemeInactiveWindowHeaderTextColor = kThemeTextColorWindowHeaderInactive,
  1497.     kThemeActivePlacardTextColor = kThemeTextColorPlacardActive,
  1498.     kThemeInactivePlacardTextColor = kThemeTextColorPlacardInactive,
  1499.     kThemePressedPlacardTextColor = kThemeTextColorPlacardPressed,
  1500.     kThemeActivePushButtonTextColor = kThemeTextColorPushButtonActive,
  1501.     kThemeInactivePushButtonTextColor = kThemeTextColorPushButtonInactive,
  1502.     kThemePressedPushButtonTextColor = kThemeTextColorPushButtonPressed,
  1503.     kThemeActiveBevelButtonTextColor = kThemeTextColorBevelButtonActive,
  1504.     kThemeInactiveBevelButtonTextColor = kThemeTextColorBevelButtonInactive,
  1505.     kThemePressedBevelButtonTextColor = kThemeTextColorBevelButtonPressed,
  1506.     kThemeActivePopupButtonTextColor = kThemeTextColorPopupButtonActive,
  1507.     kThemeInactivePopupButtonTextColor = kThemeTextColorPopupButtonInactive,
  1508.     kThemePressedPopupButtonTextColor = kThemeTextColorPopupButtonPressed,
  1509.     kThemeIconLabelTextColor    = kThemeTextColorIconLabel,
  1510.     kThemeListViewTextColor        = kThemeTextColorListView
  1511. };
  1512.  
  1513.  
  1514. enum {
  1515.     kThemeActiveDocumentWindowTitleTextColor = kThemeTextColorDocumentWindowTitleActive,
  1516.     kThemeInactiveDocumentWindowTitleTextColor = kThemeTextColorDocumentWindowTitleInactive,
  1517.     kThemeActiveMovableModalWindowTitleTextColor = kThemeTextColorMovableModalWindowTitleActive,
  1518.     kThemeInactiveMovableModalWindowTitleTextColor = kThemeTextColorMovableModalWindowTitleInactive,
  1519.     kThemeActiveUtilityWindowTitleTextColor = kThemeTextColorUtilityWindowTitleActive,
  1520.     kThemeInactiveUtilityWindowTitleTextColor = kThemeTextColorUtilityWindowTitleInactive,
  1521.     kThemeActivePopupWindowTitleColor = kThemeTextColorPopupWindowTitleActive,
  1522.     kThemeInactivePopupWindowTitleColor = kThemeTextColorPopupWindowTitleInactive,
  1523.     kThemeActiveRootMenuTextColor = kThemeTextColorRootMenuActive,
  1524.     kThemeSelectedRootMenuTextColor = kThemeTextColorRootMenuSelected,
  1525.     kThemeDisabledRootMenuTextColor = kThemeTextColorRootMenuDisabled,
  1526.     kThemeActiveMenuItemTextColor = kThemeTextColorMenuItemActive,
  1527.     kThemeSelectedMenuItemTextColor = kThemeTextColorMenuItemSelected,
  1528.     kThemeDisabledMenuItemTextColor = kThemeTextColorMenuItemDisabled,
  1529.     kThemeActivePopupLabelTextColor = kThemeTextColorPopupLabelActive,
  1530.     kThemeInactivePopupLabelTextColor = kThemeTextColorPopupLabelInactive
  1531. };
  1532.  
  1533.  
  1534. enum {
  1535.     kAEThemeSwitch                = kAEAppearanceChanged            /* Event ID's: Theme Switched */
  1536. };
  1537.  
  1538.  
  1539. enum {
  1540.     kThemeNoAdornment            = kThemeAdornmentNone,
  1541.     kThemeDefaultAdornment        = kThemeAdornmentDefault,
  1542.     kThemeFocusAdornment        = kThemeAdornmentFocus,
  1543.     kThemeRightToLeftAdornment    = kThemeAdornmentRightToLeft,
  1544.     kThemeDrawIndicatorOnly        = kThemeAdornmentDrawIndicatorOnly
  1545. };
  1546.  
  1547.  
  1548. enum {
  1549.     kThemeBrushPassiveAreaFill    = kThemeBrushStaticAreaFill
  1550. };
  1551.  
  1552.  
  1553. #if PRAGMA_STRUCT_ALIGN
  1554.     #pragma options align=reset
  1555. #elif PRAGMA_STRUCT_PACKPUSH
  1556.     #pragma pack(pop)
  1557. #elif PRAGMA_STRUCT_PACK
  1558.     #pragma pack()
  1559. #endif
  1560.  
  1561. #ifdef PRAGMA_IMPORT_OFF
  1562. #pragma import off
  1563. #elif PRAGMA_IMPORT
  1564. #pragma import reset
  1565. #endif
  1566.  
  1567. #ifdef __cplusplus
  1568. }
  1569. #endif
  1570.  
  1571. #endif /* __APPEARANCE__ */
  1572.  
  1573.